<?php
/**
 * User: 五哥派
 * Date: 2024/7/1
 * Tel(同WX): 17335592719
 */

// 应用公共文件

/**
 * @param array $data
 * @param string $message
 * @return \think\response\Json
 */
function success($message = "OK", $data = []){
    $result = [
        "code" => 1,
        "msg" => $message,
        "data" => $data
    ];
    return json($result);
}

/**
 * @param string $message
 * @param int $status
 * @param array $data
 * @return \think\response\Json
 */
function error($message = "error", $data = []) {
    $result = [
        "code" => 0,
        "msg" => $message,
        "data" => $data
    ];

    return json($result);
}